Hadamard transformation method and apparatus

ABSTRACT

The present invention provides a method and apparatus that transforms input signals X 0 , X 1 , X 2 , X 3  using a 4-point Hadamard transform matrix, and of the resulting transformation data, rounds up the LSB of the first transformed data and rounds down the LSB of the remaining odd-numbered data. When restoring the data to its original state the rounding is executed after a Hadamard inverse transformation is performed, thereby restoring the data to its original state X 0 , X 1 , X 2 , X 3.

FIELD OF THE INVENTION

[0001] The present invention relates to Hadamard transformation methodand apparatus, and more particularly, to a Hadamard transformationmethod and apparatus capable of providing a reversible transformation.

BACKGROUND OF THE INVENTION

[0002] Images, particularly color images, contain a very large amount ofinformation. This vary large amount of information makes it difficult tostore or transmit such images, so high-performance encoding is used toreduce the amount of such data, either by deleting the redundancy ofsuch color images or by encoding the images by altering their contentsto the point where picture quality deteriorates noticeably. Thus, forexample, with the JPEG recommended by the ISO and ITU-T as theinternational standard encoding method for data compression anddecompression of still images, a discrete cosine transform (DCT) is usedto transform each block of image data (8 pixels×8 pixels) into a DCTcoefficient, after which the resulting DCT coefficients are individuallyquantized and the quantized values are entropy encoded to compress theimage data. Besides JPEG, this DCT-based compression technique includesH261, MPEG1/2/4, and so on.

[0003] One process relating to DCT and to image data conversion is theHadamard transform. The Hadamard transform is an orthogonaltransformation in which each of the elements or entries in the matrix iseither 1 or −1. A Hadamard transform can be performed using onlyaddition and subtraction, and is the simplest of orthogonaltransformations.

[0004] Within the Hadamard transform, a 2-point Hadamard transformmatrix H₂ is defined as follows: $\begin{matrix}{H_{2} = {\frac{1}{\sqrt{2}}\begin{bmatrix}1 & 1 \\1 & {- 1}\end{bmatrix}}} & (1)\end{matrix}$

[0005] An ordinary N-term Hadamard transform matrix H_(N) (whereN=2^(n)) can be recursively defined by the Kronecker product of an(N/2)-term Hadamard transformation and the foregoing 2-point Hadamardtransformation H₂ as follows: $\begin{matrix}\begin{matrix}{H_{N} = {H_{N/2} - H_{2}}} \\{= {\frac{1}{\sqrt{2}}\begin{bmatrix}H_{W/2} & H_{W/2} \\H_{W/2} & {- H_{W/2}}\end{bmatrix}}}\end{matrix} & (2)\end{matrix}$

[0006] From the foregoing definition a 4-point Hadamard transform matrixcan be obtained as follows: $\begin{matrix}{H_{4} = {\frac{1}{2}\begin{bmatrix}1 & 1 & 1 & 1 \\1 & {- 1} & 1 & {- 1} \\1 & 1 & {- 1} & {- 1} \\1 & {- 1} & {- 1} & 1\end{bmatrix}}} & (3)\end{matrix}$

[0007] Such a 4-point Hadamard transform matrix is called a naturalmatrix, in which the base vectors are not aligned in the order of thesequency. By repeatedly performing permutations of the base vectors soas to move the second line base vector to the forth line, the order ofthe base vectors becomes the sequence order of the transformation matrixWH₄: $\begin{matrix}{{WH}_{4} = {\frac{1}{2}\begin{bmatrix}1 & 1 & 1 & 1 \\1 & 1 & {- 1} & {- 1} \\1 & {- 1} & {- 1} & 1 \\1 & {- 1} & 1 & {- 1}\end{bmatrix}}} & (4)\end{matrix}$

[0008] This transformation matrix WH₄ is called a Walsh-typetransformation matrix or a Walsh-Hadamard transform matrix. It is knownthat a Hadamard transform is a reversible orthogonal transformation, soas long as either the natural- or the Walsh-type matrix can bereversibly transformed the transformation matrix is a symmetricalmatrix.

[0009] Besides the Walsh-type transformation matrix, there is one othertype of symmetrical matrix obtained by permutation the base vectors ofthe Hadamard transform matrix H₄, which is the following matrix HH₄:$\begin{matrix}{{HH}_{4} = {\frac{1}{2}\begin{bmatrix}1 & 1 & 1 & 1 \\1 & {- 1} & {- 1} & 1 \\1 & {- 1} & 1 & {- 1} \\1 & 1 & {- 1} & {- 1}\end{bmatrix}}} & (5)\end{matrix}$

[0010] This transform matrix HH₄ has an important meaning in thedetailed description of the invention that follows later.

[0011] As noted above, it is widely known that the Hadamard transform isreversible, a precondition of which is the retention without rounding ofthe decimal fraction generated when performing a Hadamard transformationof whole numbers (integers).

[0012] Reversibility is lost if the decimal fraction is simply roundedoff. For example, a Hadamard transform of the following numbers

[0013] 123, 78, 84, 56

[0014] produces the following results:

[0015] 170.5(=(123+78+84+56)/2)

[0016] 36.5(=(123−78+84−56)/2)

[0017] 30.5(=(123+78−84−56)/2)

[0018] 8.5(=(123−78−84+56)/2)

[0019] Rounding these numbers to integers yields the following:

[0020] 171, 37, 31, 9

[0021] the inverse transformation of which yields the following:

[0022] 124, 78, 84, 56

[0023] As can be seen, the first number 123, by a Hadamardtransformation and its inverse transformation, has become 124. Thus,reversibility cannot be guaranteed with the Hadamard transform, whichoutputs integerized data. Hereinafter, a Hadamard transform that outputsintegerized data is called an integer-type Hadamard transformation, andan integer-type Hadamard transformation that can be reversiblytransformed is called an integer-type reversible Hadamardtransformation.

[0024] The present invention is directed to a method of calculating androunding so as to achieve an integer-type reversible Hadamardtransformation.

[0025] Conventionally, an integer-type reversible Hadamardtransformation is achieved as follows:

[0026] (1) Resolve the 4-point Hadamard transform H₄ into the product oftriangular matrixes whose main diagonal elements are equal to 1

[0027] (2) Add a row vector replacing Q to the original transformationmatrix

[0028] (3) From (1) and (2), resolve QH₄ into the following matrixproduct form. $\begin{matrix}{{QH}_{4} = {{\begin{bmatrix}1 & 0 & 0 & 0 \\0 & 1 & 0 & 0 \\0 & {- 1} & 1 & 0 \\{- 1} & 0 & 0 & 1\end{bmatrix}\begin{bmatrix}1 & 0 & {1/2} & {1/2} \\0 & 1 & {1/2} & {{- 1}/2} \\0 & 0 & 1 & 0 \\0 & 0 & 0 & 1\end{bmatrix}}\begin{bmatrix}{- 1} & 0 & 0 & 0 \\0 & {- 1} & 0 & 0 \\1 & 0 & 1 & 0 \\0 & {- 1} & 0 & 1\end{bmatrix}}} & (6)\end{matrix}$

[0029] (4) Express this transformation as signal flow (as shown in FIG.1)

[0030] (5) Round off any decimal fraction data generated bymultiplication during signal flow.

[0031] Conventionally, an integer-type reversible Hadamardtransformation is achieved by the foregoing steps (1) through (5). Aslightly more detailed explanation is given below.

[0032]FIG. 1 is a diagram illustrating a signal flow that forms thefoundations of achieving a conventional integer-type reversible Hadamardtransformation. FIG. 2 is a diagram illustrating the signal flow of theconventional integer-type reversible Hadamard transformation.

[0033] The signal flow of FIG. 1 shows a so-called ladder network oftenused to achieve a reversible transformation. The ladder network shown inFIG. 1 introduces rounding (reference numerals 200 and 201 of FIG. 2) tothe nearest integer on the output side of multipliers 100, 101 thatgenerate decimal fraction data, with the reversibility of thetransformation that outputs integerized data being used as a commontechnique (in the field of reversible transformation).

[0034] It should be noted that the methods of the rounding 200, 201 canbe anything provided that the rounding of the corresponding multiplieroutputs is the same for the forward transformation and the inversetransformation.

[0035] A signal flow that introduces rounding into the signal flow ofFIG. 1 so as to achieve reversibility is shown in FIG. 2, and is theconventional calculation method for achieving an integer-type reversibleHadamard transformation.

[0036] The Hadamard transformation defined by equations (3), (4) and (5)above can be achieved by regular addition and subtraction, and can beprocessed in parallel efficiently SIMD (Single Instruction streamMultiple Data stream)-type commands such as those provided on currentCPUs. However, with the above-described conventional reversibletransformation calculation method, it is difficult to process usingSIMD-type commands and there are few calculations that can be performedin parallel.

[0037] In other words, it can be said that the conventional integer-typereversible Hadamard transformation is not suitable for high-speedprocessing on the personal computers that are now ubiquitous. Similarly,the hardware also experiences extended delays because of the increasednumber of calculations involved, lengthening the data pass.

SUMMARY OF THE INVENTION

[0038] Accordingly, the present invention is proposed in order to solvethe above-described problems of the conventional art, and has as itsobject to provide a Hadamard transformation method and apparatus thatachieves an integer-type reversible Hadamard transformation by roundingup the last bit of odd number of data in the transformed data obtainedby Hadamard transformation and rounding down the last bit of theremaining odd number of data.

[0039] Another object of the present invention is to provide a Hadamardtransformation method and apparatus that achieves an integer-typereversible Hadamard transformation by simultaneously rounding up thelast bit of odd number of transformation output and rounding down thelast bit of the remaining odd number of transformation output as well asperforming a Hadamard transformation.

[0040] Another and further object of the present invention is to providea Hadamard transformation method and apparatus capable of performinginteger-type reversible Hadamard transformations with little delay and asimple structure.

[0041] In order to attain the above-described objects, a Hadamardtransformation and inverse transformation method of the presentinvention comprising: a transformation step of performing a Hadamardtransformation of an input signal using a Hadamard transform matrix; anda rounding step of rounding up the least significant bit of odd numberof data in the transformed data transformed in said transformation stepand rounding down the LSB of remaining odd number of data.

[0042] Other features, objects and advantages of the present inventionwill be apparent from the following detailed description taken inconjunction with the accompanying drawings, in which like referencecharacters designates the same or similar parts throughout the figuresthereof.

BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The accompanying drawings, which are incorporated in andconstitute a part of the specification, illustrate embodiments of thepresent invention and, together with the detailed description, serve toexplain the principle of the present invention, in which:

[0044]FIG. 1 is a diagram illustrating a signal flow that forms thefoundations of achieving a conventional integer-type reversible Hadamardtransformation;

[0045]FIG. 2 is a diagram illustrating the signal flow of theconventional integer-type reversible Hadamard transformation;

[0046]FIG. 3 is a flow chart illustrating steps in a reversible Hadamardtransformation according to a first embodiment of the present invention;

[0047]FIG. 4 is a flow chart illustrating the Hadamard transformationand a rounding variation according to the first embodiment of thepresent invention;

[0048]FIG. 5 is a flow chart illustrating steps in a reversible Hadamardtransformation according to a second embodiment of the presentinvention;

[0049]FIG. 6 is a flow chart illustrating steps in a inversetransformation of a reversible transform according to a secondembodiment of the present invention;

[0050]FIGS. 7A, 7B and 7C are diagrams illustrating errors generated byrounding during a reversible Hadamard transformation of 8 sets, errorspropagated by the inverse transformations corresponding to thetransformations, and errors generated by rounding during said inversetransformations, respectively, according to a third embodiment of thepresent invention;

[0051]FIG. 8 is a block diagram showing the structure of a 4-pointHadamard transformation processing unit according to a fourth embodimentof the present invention;

[0052]FIG. 9 is a diagram showing an 8-set reversible Hadamardtransformation processor and each corresponding inverse transformationprocessor according to the fourth embodiment of the present invention;

[0053]FIG. 10 depicts a diagram illustrating a Hadamard transformationaccording to a fifth embodiment of the present invention; and

[0054]FIG. 11 depicts a diagram illustrating a Hadamard transformationaccording to a sixth embodiment of the present invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0055] Preferred embodiments of the present invention will be describedin detail in accordance with the accompanying drawings.

[0056] [First Embodiment]

[0057]FIG. 3 is a flow chart illustrating steps in a reversible Hadamardtransformation according to a first embodiment of the present invention.

[0058] In FIG. 3, in a step S301, with fixed point arithmetic, a 4-pointHadamard transform matrix H₄ is used for transformation. The input datais Xi=[X0, X1, X2, X3] and a calculation shown as Di=H₄·Xi is executed.In a step S302, only the first (D0) of the transformation resultsobtained in step S301 is rounded up. Next, in a step S303, the remainingtransformation results (D1, D2, D3) are each rounded down.

[0059] In step S301, 4-point Hadamard transformation using fixed pointarithmetic is performed by adding and subtracting integer-type inputdata and substituting for the fixed-point variables. Here, the decimalfraction is only the last bit (hereinafter called the LSB, or leastsignificant bit), whose weight is 0.5. In the rounding up process ofstep S302, after adding 1 to the first piece of data (D0), there is ashift 1 bit to the right. The added 1 is interpreted as having the same0.5 weight as the LSB. The shift to the right 1 bit is to round down thedecimal fraction of this addition result and leave only the integerpart, so as to be transformed into integerized data.

[0060] In the rounding down process of the step S303, there is a shiftto the right 1 bit without adding anything, which rounds down thedecimal fraction of the transformation results of step S301 and leavingonly the integer part, so as to be transformed into integerized data.

[0061] The rounding down and rounding up processes of the presentembodiment are mathematical floor function calculations and mathematicalceiling function calculations. The former is a transformation to thelargest integer that does not exceed the input data and the latter is atransformation to the smallest integer which is greater than or equal tothe input data.

[0062] Viewed from another aspect, the values neither increase due tothe rounding down process nor decrease due to the rounding up process.With the number “−7.5”, for example, the result of rounding down is “−8”(which is smaller than the original value) and the result of rounding upis “−7” (which is larger than the original value).

[0063] In the present embodiment, the steps of the inversetransformation become the same as those shown in the flow chart of FIG.3. Thus, for the four data mentioned previously, namely

[0064] 123, 78, 84, 56

[0065] the application of the integer-type reversible Hadamard transformof the present embodiment produces transformed date after rounding thatlooks like this:

[0066] 171(=(123+78+84+56)/2 rounding up the first digit after thedecimal point),

[0067] 36(=(123−78+84−56)/2 rounding down the first digit after thedecimal point),

[0068] 30(=(123+78−84−56)/2 rounding down the first digit after thedecimal point),

[0069] 8(=(123−78−84+56)/2 rounding down the first digit after thedecimal point)

[0070] An inverse transformation is performed on these transformationresults in the order shown in the flow chart of FIG. 3, to obtain thefollowing values:

[0071] 171, 36, 30, 8

[0072] Performing just an Hadamard inversion transformation on theforegoing results produces the following:

[0073] 122.5(=(171+36+30+8)/2)

[0074] 78.5(=(171−36+30−8)/2)

[0075] 84.5(=(171+36−30−8)/2)

[0076] 56.5(=(171−36−30+8)/2)

[0077] If the LSB of the first datum (122.5) is rounded up and the LSBof the rest of the data (78.5, 84.5, 56.5) is rounded down, thefollowing values are obtained:

[0078] 123, 78, 84, 56

[0079] In other words, the data reverts to its original state. Why thistype of reversible transformation can be achieved is explained below.

[0080] It is well known that the values of the LSB of the four pieces ofdata that are Hadamard transformed by the fixed point arithmetic of stepS301 of FIG. 3 all become the same. These LSB values are uniquelydetermined by how many odd-numbered data there are in the four pieces ofdata prior to transformation. In other words, if there are even numberof the odd-numbered data, then the LSB value becomes 0, and if there areodd number of the odd-numbered data, then the LSB value becomes 1.

[0081] If the LSB value is 0, then the decimal fraction becomes zero, sointeger data is already present at the output of the transformation ofstep S301. Accordingly, no error is generated by the rounding in thesucceeding steps S302 and S303. In this case, in an inversetransformation as well, integer data is produced only with thetransformation of step S301, and the data is restored to its originalstate regardless of whether there is rounding or not.

[0082] On the other hand, in the transformation of step S301, if the LSBvalue is 1 (in the case of 0.5), then rounding to the nearest integerimposes an error of “+0.5” or “−0.5” on the data. By processing the 4sets of data shown in FIG. 3, an error of “+0.5” is imposed on the firsttransformation data Y0 and an error of “−0.5” is imposed on theremaining three sets of data Y1, Y2 and Y3.

[0083] If such error-imposed transformation data is inverse-processedaccording to the steps shown in FIG. 3, then the error is propagated tothe pre-rounded transformation data D0 (error “−0.5”) and D1, D2 and D3(error “+0.5”). In order to negate this propagated error, only D0 isrounded up while the remaining three sets of data D1, D2 and D3 arerounded down. In step S302 and step S303, performing such processesrestores the data to its original state.

[0084] Accordingly, the process depicted in FIG. 3 makes possible notonly an integer-type reversible Hadamard transform but also an inversetransform.

[0085] The only case in which a transformation and an inversetransformation can be achieved with the same process is an instance inwhich only the rounding of the first transformation data differs fromthe rounding of the other three sets of data. There is one other type ofprocess in which the rounding of the transformation data Y0 is differentfrom those of the other three sets of data, and that is a process inwhich only Y0 is rounded down and the remaining three are rounded up. Inthis instance as well, however, both transformation and inversetransformation can be achieved with the same process.

[0086] It should be noted that the process shown in FIG. 3 can bevaried, and transformation and rounding can be carried outsimultaneously.

[0087] [Second Embodiment]

[0088]FIG. 5 is a flow chart illustrating steps in a reversible Hadamardtransformation according to a second embodiment of the presentinvention. FIG. 6 is a flow chart illustrating steps in a inversetransformation of a reversible transform according to a secondembodiment of the present invention.

[0089] A second embodiment of the present invention will now bedescribed using a case in which the rounding of the transformation andthe rounding of the inverse transformation are different. In the secondembodiment of the present invention, only the second transformation data(D1) is rounded up, while the remaining three sets of data (D0, D2, D3)are rounded down. As noted above, steps in the process of transformationof the second embodiment of the present invention are shown in FIG. 5and steps in the process of inverse transformation of the secondembodiment of the present invention are shown in FIG. 6.

[0090] With the second embodiment of the present invention as well, aswith the first embodiment described above, in the fixed point arithmeticof step S301, if the LSB of the four calculation results is 1 then thereis a problem with reversibility. When the LSB is 0, no error isgenerated during rounding and so an inverse transformation is possible.

[0091] Accordingly, the following is an explanation only with respect toa case in which the LSB is 1.

[0092] According to the process shown in FIG. 5, an error of +0.5 isimposed only on the second transformation data Y1, with an error of −0.5imposed on the remaining transformation data Y0, Y2 and Y3.

[0093] Inverse transformation of the foregoing according to the flowdepicted in FIG. 6 first propagates an error of +0.5 for only the thirdtransformation data E2 by the fixed point arithmetic transformation of astep S601 and propagates an error of −0.5 for the remaining threetransformation data E0, E1, E3.

[0094] Accordingly, in a step S602, the LSB of each of thetransformation data E0, E1, E3 is rounded up and in a step S603 the LSBof the third transformation data E2 is rounded down. As a result, theerror is eliminated so as to be able to obtain the original data R0-R3prior to transformation.

[0095] [Third Embodiment]

[0096]FIGS. 7A, 7B and 7C are diagrams illustrating errors generated byrounding during a reversible Hadamard transformation of 8 sets, errorspropagated by the inverse transformations corresponding to thetransformations, and errors generated by rounding during said inversetransformations, respectively, according to a third embodiment of thepresent invention.

[0097] A third embodiment of the present invention uses neither anatural type nor a Walsh-type transform but the previously described oneother transformation matrix (5): $\begin{matrix}{{HH4} = {\frac{1}{2}\begin{bmatrix}1 & 1 & 1 & 1 \\1 & {- 1} & {- 1} & 1 \\1 & {- 1} & 1 & {- 1} \\1 & 1 & {- 1} & {- 1}\end{bmatrix}}} & (5)\end{matrix}$

[0098] This matrix is one in which permutation of the base vector of thefourth line of a natural-type matrix is performed twice and the resultis moved to the second line. Using this type of transformation matrixproduces integer-type Hadamard transformed transformation data S0, S1,S2, S3, with the eight types of reversible rounding (types 0 through 7)defined as follows:

[0099] A rounding type in which three of the transformation data arerounded up and one rounded down is assigned types 0-3, and a roundingtype in which three of the transformation data are rounded down and onlyone rounded up is assigned to types 4-7. More precisely, when roundingdown only one, in a case where one transformation data is Si, therounding is type i. Similarly, when rounding up only one, in a casewhere one transformation data is Sj, the rounding type is type (j+4).

[0100] Using the above-described definitions, the type of rounding usedin order to restore the data to its original state when type i roundingis used during transformation is the 8's complement of i. If, forexample, a type 2 rounding is used during transformation, then the datacan be restored to its original state by inverse transformation usingrounding type 6, which is the 8's complement of 2.

[0101] As noted above, errors imposed on the four transformation outputdata by the rounding types 0-7 are shown in FIG. 7A, the propagatederrors during inverse transformation are shown in FIG. 7B and therounding processes used during inverse transformation to eliminate suchpropagated errors are shown in FIG. 7C.

[0102] By numbering the rounding processes during transformation fromFIGS. 7A, 7B and 7C in the order of the third embodiment of the presentinvention, it can be seen that the type of rounding duringtransformation and the corresponding type of rounding during inversetransformation are 8's complements. It should be noted that, wheretransformation matrixes other than transformation matrix (5) are used,there are eight types of rounding during transformation and roundingduring inverse transformation is uniquely determined. (However, thatrelation does not devolve to a simple rule like that described above)

[0103] [Fourth Embodiment]

[0104] A fourth embodiment of the present invention is shown as ahardware configuration that matches the transformation roundingprocesses and the inverse transformation rounding processes of the thirdembodiment of the present invention.

[0105]FIG. 8 is a block diagram showing the structure of a Hadamardtransformation processing unit according to a fourth embodiment of thepresent invention. In FIG. 8, reference numeral 801 denotes the Hadamardtransformation processing unit, which is used for both transformationand inverse transformation.

[0106]FIG. 9 is a diagram showing an 8-set integer type of reversibleHadamard transformation processor and each corresponding inversetransformation processor according to the fourth embodiment of thepresent invention. In FIG. 9, the left side of the dotted line 901indicates processes performed by the transformation processor and theright side of the dotted line 901 shows processes performed by theinverse transformation processor.

[0107] The unit group 903 that is at the initial stage of the output ofthe Hadamard transformation unit 801 is an adder that adds 1. The actualweight (that is, when converted into output result) of the 1 added hereis 0.5. The second stage unit group 905 is a 1-bit shift unit forremoving the LSB that is the decimal point so as to leave only theinteger part. Physically, the decimal fraction is not connected and onlythe integer part is connected. This description holds for both thetransformation unit and the inverse transformation unit.

[0108] [Fifth Embodiment]

[0109]FIG. 10 depicts a diagram illustrating a Hadamard transformationaccording to a fifth embodiment of the present invention; and

[0110] The fifth embodiment of the present invention does not limit therounding process to just the two simple processes of rounding up androunding down but is instead generalized. That is, during rounding, theprocess is not limited to either adding nothing (or, to put it anotherway, adding 0) or adding 1, but is instead able to add values other than0 and 1. A transformation process that becomes an integer-typereversible Hadamard transform even when the added values are other than0 or 1 is shown in FIG. 10, which is the transformation of this fifthembodiment. Although this transformation process uses a Walsh-Hadamardtransformation matrix, it is possible to use any of the above-describedthree types of transformation matrixes.

[0111] In FIG. 10, in a step S100, Mi (where i=0, 1, 2, 3) is aninteger, Si=0, 1 (i=0, 1, 2, 3) and S0+S1+S2+S3=1, 3. Under suchconditions, the transformation of step S1003 of FIG. 8 becomes aninteger-type reversible Hadamard transform. The limiting of Mi to 0 isas per the embodiments described above.

[0112] When performing a continuous reversible Hadamard transformationon data acquired using the same rounding process, the rounding processadded value calculation step S1001 described above need only be carriedout once in the beginning. Thereafter, the Hadamard transformation androunding of step S1003 are carried out as many times as necessary.

[0113] [Sixth Embodiment]

[0114]FIG. 11 depicts a diagram illustrating a Hadamard transformationaccording to a sixth embodiment of the present invention.

[0115] The fifth embodiment of the present invention described above iseffective when carrying out integer-type reversible Hadamard transformsvertically no matter how many steps are involved. For 16-bit data, whenthe data is transposed in 4-bit units and further transformed in 4-bitunits, it is useful in relaxing the margin of error, which concentrateslocally. FIG. 11 shows one example of such a structure.

[0116] In the diagram, reference numerals 1101-1108 denote Hadamardtransformation units (HT units). The transformation matrixes of thesetransformation units may be any of the three types described above.Reference numeral 1111 denotes an adding unit that adds 1, referencenumeral 1113 denotes an adding unit that adds −1, reference numeral 1115denotes an adding unit that adds 2 and reference numeral 1121 denotes abit shift unit.

[0117] When configured as shown in FIG. 11, a perusal of the last fourdownstream HT units (that is, the four units shown at the right of thediagram) shows that rounded-up data concentrates at the HT unit 1105 androunded-down data concentrates at the HT units 1106-1108. A margin oferror of +0.5 is imposed on the rounded-up data while a margin of errorof −0.5 is imposed on the rounded-down data.

[0118] When such data is further subjected to a Hadamard transformation,these margins of error concentrate at the transform coefficient Y0. Thatis, the margins of error imposed on the input data concentrate at thetransform coefficient Y0 of the HT unit 1105, maximizing at +1. Bycontrast, at the other transformation coefficients Y1, Y2, Y3, themargin of error is cancelled out and averages out to 0. HT units1106-1008 likewise experience a concentration of the imposed margins oferror at the Y0 transformation coefficient, maximizing at −1, whereasthe margins of error are canceled out at the other transformationcoefficients Y1, Y2, Y3 to average out at 0.

[0119] One method of making the margin of error imposed on the output ofthe transformation coefficient Y0 at HT unit 1105 the same as the othertransformation coefficients is by setting, in FIG. 10, M1=−1, S0=1 andthe rest all 0. By using these settings, the margins of error imposed onthe output transformation coefficients of all four transformationcoefficients Y0, Y1, Y2 and Y3 are distributed over a range of from −1to +0.5.

[0120] Similarly, one method of making the margin of error imposed onthe output of the transformation coefficient Y0 of the HT units1106-1108 the same as that of the other transformation coefficients isto set M1=1, S1=S2=S3=1 in the process shown in FIG. 10, while settingthe rest to 0. By using these settings, the margins of error imposed onthe output transformation coefficients of all four transformationcoefficients Y0, Y1, Y2 and Y3 are distributed over a range of from −0.5to +1.

[0121] The integer-type reversible Hadamard transform method andapparatus according to the fourth embodiment of the present inventioncan also be used to process a portion of a DCT transformation. In otherwords, a reversible DCT that outputs integer-type data suitable forhigh-speed processing can be achieved by replacing the Hadamardtransformation processor with the reversible Hadamard transformationmethod of the present embodiment or with the reversible Hadamardtransformation unit of the present embodiment.

[0122] Although the above-described Hadamard transformation method andapparatus has been described in terms of processing of one-dimension4-point data, it can also be used to carry out secondary transformationsof 4×4 two-dimensionally arrayed data as well, by applying the processin both the horizontal and vertical directions. Such a reversibleHadamard transform method and apparatus for two-dimensional data is ofcourse within the scope of the present invention.

[0123] It should be noted that the present invention is equallyapplicable to a system comprising a plurality of components (such as ahost computer, interface, reader, printer, and so on) as well as asystem comprising but a single component (such as a copier, facsimilemachine, or the like).

[0124] In addition, as can be appreciated by those of skill in the art,the object of the present invention may also be achieved by a softwareprogram code for achieving the functions of the foregoing embodimentsbeing recorded onto a storage medium (or recording medium) that issupplied to a system or an apparatus, with a computer of that system orapparatus then reading the program code stored on the recording medium.In such a case, the program code read from the recording medium itselfachieves the functions of the above-described embodiments, and therecording medium on which that program code is recorded constitutes thepresent invention. In addition, the present invention includes also aninstance in which the execution of the program code read by the computernot only results in the achievement of the functions of theabove-described embodiments but also the operating system (OS) operatingin the computer performs part or all of the actual processing based onthe instructions of the program code, with the functions of theabove-described embodiments being achieved based on that processing.

[0125] Moreover, as can be appreciated by those of skill in the art, thepresent invention also includes an instance in which the functions ofthe above-described embodiments are achieved by processes executed inwhole or in part by a CPU or the like provided in a function expansioncard or a function expansion unit based on program code instructions,after the program code read from the recording medium is written to amemory provided in such a function expansion card inserted into thecomputer or such a function expansion unit connected to the computer.

[0126] As described above, according to the embodiments of the presentinvention, by performing a 4-point Hadamard transformation with a singlematrix calculation, and of the 4 sets of data obtained by thattransformation, rounding up the odd-numbered data LSB and rounding downthe remaining odd-numbered data LSB, it is possible to achieve, at highspeed using simple calculations, an integer-type reversible Hadamardtransform as well as an inverse transformation corresponding to thattransformation which restores the data to its original state.

[0127] Further, by simultaneously performing both rounding in such a wayas to round up the odd-numbered transformation output results and rounddown the remaining odd-numbered transformation output, as well astransformation using the 4-point Hadamard transform matrix, it ispossible to achieve, at high speed using simple calculations, aninteger-type reversible Hadamard transform as well as an inversetransformation corresponding to that transformation which restores thedata to its original state.

[0128] Similarly, by employing a 4-point Hadamard transformation unit(composed only of butterfly calculations), rounding up the odd-numberedoutput of such an Hadamard transformation unit and rounding down theremaining odd-numbered transformation output, it is possible to achieve,at high speed using simple calculations, an integer-type reversibleHadamard transform as well as an inverse transformation corresponding tothat transformation which restores the data to its original state withlittle calculation delay.

[0129] The present invention is not limited to the above embodiments andvarious changes and modifications can be made within the spirit andscope of the present invention. Therefore, to apprise the public of thescope of the present invention, the following claims are made.

What is claimed is:
 1. A Hadamard transformation and inversetransformation method comprising: a transformation step of performing aHadamard transformation of an input signal using a Hadamard transformmatrix; and a rounding step of rounding up the least significant bit ofodd number of data in the transformed data transformed in saidtransformation step and rounding down the LSB of remaining odd number ofdata.
 2. The inverse Hadamard transformation method according to claim1, comprising a reversion step of restoring data to its original stateby inverse transformation corresponding to said transformation step androunding corresponding to said rounding step.
 3. The Hadamardtransformation method according to claim 1, wherein the Hadamardtransform matrix is a 4-point Hadamard transform matrix.
 4. The Hadamardtransformation method according to claim 2, wherein the rounding in saidreversion step is uniquely determined for said rounding step and is thesame rounding as is carried out in said rounding step.
 5. The Hadamardtransformation method according to claim 3, wherein eight types ofrounding exist in said rounding step.
 6. The Hadamard transformationmethod according to claim 2, wherein the type of rounding in saidrounding step and the type of rounding during inverse transformation insaid reversion step are made to be complementary.
 7. A Hadamardtransformation method comprising: a transformation step of performing aHadamard transformation using a Hadamard transform matrix; a roundingstep of rounding up the least significant bit of odd number oftransformation output in the transformation results output of saidtransformation step and rounding down the LSB of remaining odd number oftransformation output; an inverse transformation step of performing aninverse Hadamard transformation of the transformation output rounded insaid rounding step; and a reversion step of restoring the data to itsoriginal state by performing the same rounding as the rounding of saidrounding step for the transformation results of said inversetransformation step.
 8. The Hadamard transformation method according toclaim 7, wherein: eight types of rounding exist in said rounding step;and the rounding -in said reversion step is uniquely determined for therounding in said rounding step.
 9. The image input apparatus accordingto claim 7, wherein the rounding in said reversion step is made to havea 8's complementary relation with the rounding during eight types oftransformations in said rounding step.
 10. A Hadamard transformationapparatus comprising: Hadamard transformation means; and rounding meansfor rounding up odd number of LSB of transformation output by saidHadamard transformation means and rounding down remaining odd number oftransformation output LSB
 11. The Hadamard transformation apparatusaccording to claim 10, further comprising reversion means for restoringdata to its original state by inverse transformation corresponding tosaid Hadamard transformation means and rounding corresponding to saidrounding means.
 12. A Hadamard transformation apparatus comprising:transformation means for performing a Hadamard transformation using a4-point Hadamard transform matrix; rounding means for rounding up theleast significant bit of odd-numbered transformation output in thetransformation results output by said transformation means and roundingdown the LSB of remaining odd-numbered transformation output; inversetransformation means for performing an inverse Hadamard transformationof the transformation output rounded by said rounding means; andreversion means for restoring the data to its original state byperforming the same rounding as the rounding of said rounding means forthe transformation results of said inverse transformation means.
 13. Aprogram that causes a computer to execute a Hadamard transformationmethod comprising: a transformation step of performing a Hadamardtransformation of an input signal using a Hadamard transform matrix; anda rounding step of rounding up the least significant bit of eachodd-numbered data in the transformed data transformed in saidtransformation step and rounding down the least significant bit ofremaining odd-numbered data.
 14. A computer-readable recording medium onwhich is recorded a program that causes a computer to execute a Hadamardtransformation method comprising: a transformation step of performing aHadamard transformation of an input signal using a Hadamard transformmatrix; and a rounding step of rounding up the least significant bit ofeach odd-numbered data in the transformed data transformed in saidtransformation step and rounding down the least significant bit ofremaining odd-numbered data.
 15. A Hadamard transformation apparatus,comprising: calculation means for adding and subtracting 4 integer inputdata in accordance with a 4-point Hadamard transform matrix; additionmeans for adding predetermined values to the transformed results by saidcalculation means and outputting the added data; and rounding means forrounding down the least significant bit of the added data outputted bysaid addition means, wherein the predetermined values are 2Mi+Si (i=0,1, 2, 3) wherein Mi is an integer number, Si is 0 or 1, andS0+S1+S2+S3=1 or
 3. 16. A Hadamard transformation method, comprising thesteps of: adding and subtracting 4 integer input data in accordance witha 4-point Hadamard transform matrix; adding predetermined values to theHadamard transformed results and outputting the added data; and roundingdown the least significant bit of the added data, wherein thepredetermined values are 2Mi+Si (i=0, 1, 2, 3) wherein Mi is an integernumber, Si is 0 or 1, and S0+S1+S2+S3=1 or
 3. 17. A program that causesa computer to execute a Hadamard transformation method comprising thesteps of: adding and subtracting 4 integer input data in accordance witha 4-point Hadamard transform matrix; adding predetermined values to theHadamard transformed results and outputting the added data; and roundingdown the least significant bit of the added data, wherein thepredetermined values are 2Mi+Si (i=0, 1, 2, 3) wherein Mi is an integernumber, Si is 0 or 1, and S0+S1+S2+S3=1 or
 3. 18. A computer-readablerecording medium on which is recorded a program that causes a computerto execute a Hadamard transformation method comprising the steps of:adding and subtracting 4 integer input data in accordance with a 4-pointHadamard transform matrix; adding predetermined values to the Hadamardtransformed results and outputting the added data; and rounding down theleast significant bit of the added data, wherein the predeterminedvalues are 2Mi+Si (i=0, 1, 2, 3) wherein Mi is an integer number, Si is0 or 1, and S0+S1+S2+S3=1 or 3.